package com.hdd.biz.painting.controller;


import com.hdd.biz.painting.dto.TopicListRequest;
import com.hdd.biz.painting.dto.TopickRequest;
import com.hdd.biz.painting.dto.WorksListRequest;
import com.hdd.biz.painting.service.PaintingTopicService;
import com.hdd.dto.SuperResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * <p>
 * 话题列表 前端控制器
 * </p>
 *
 * @author fang
 * @since 2021-02-25
 */
@RestController
@RequestMapping("/painting/topic")
@Api(value = "话题模块",tags = {"话题模块"})
@CrossOrigin(origins = "*",maxAge = 3600)
public class PaintingTopicController {


    @Autowired
    private PaintingTopicService topicService;


    @PostMapping("/list")
    @ApiOperation(value = "话题列表" ,notes = "")
    public SuperResponse list(@Valid @RequestBody TopicListRequest request ){
        return topicService.list(request);
    }

    @PostMapping("/info")
    @ApiOperation(value = "话题详情" ,notes = "")
    public SuperResponse info(@Valid @RequestBody TopickRequest request ){
        return topicService.info(request);
    }


    @PostMapping("/add")
    @ApiOperation(value = "添加话题" ,notes = "")
    public SuperResponse add(@Valid @RequestBody TopickRequest request ){
        return topicService.add(request);
    }

    @PostMapping("/update")
    @ApiOperation(value = "修改话题" ,notes = "")
    public SuperResponse update(@Valid @RequestBody TopickRequest request ){
        return topicService.update(request);
    }


    @PostMapping("/delete")
    @ApiOperation(value = "删除话题" ,notes = "")
    public SuperResponse delete(@Valid @RequestBody TopickRequest request ){
        return topicService.delete(request);
    }

}

